package com.ddzh.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ddzh.pojo.CheckGroup;
import com.ddzh.vo.CheckGroupVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public interface CheckGroupMapper extends BaseMapper<CheckGroup> {
    @Select("select g.* from setmeal_group_t sgt inner join item_group_t g on g.id=sgt.group_id\n" +
            "where sgt.setmeal_id=#{setmealId}")
    List<CheckGroupVo> getDetail(@Param("setmealId") Long setmealId);

    @Select("select * from item_group_t where name=#{name} and is_delete=0")
    CheckGroup findByName(@Param("name") String name);

    @Select("select * from item_group_t where code=#{code} and is_delete=0")
    CheckGroup findByCode(@Param("code") String code);
}
